<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<title>添加事件</title>
	<style type="text/css">
		body{
			background-color:#F3F1EC;
		}
	</style>
</head>
<body>
	<%@ include file="include/base.jsp" %>
	<%@ include file="include/base-top.jsp" %>
	<div class="container-fluid" style="margin-top:60px;">
		<div class="row-fluid">
			<div class="span8">
				<div class="alert alert-danger"><i class="icon-lock"></i>只对我可见</div>
				<div class="well" style="box-shadow:0 0 3px #CCCCCC;background-color:#F0F5F8;margin-top:-20px;">
					<div>
						<div style="float:left;height:100px;"><img src="image/mei.png" alt=""/></div>
						
						<p class="pull-right">由<strong>${employee.name}</strong>添加|<a href="editchance.jspx?id=${chance.id}"><img src="image/edit.png"/></a></p>
						<p style="font-size:18px;"><a href="">${contact.contactname} <h3>${ev.des }</h3></a>：${item.chancename}</p>
						<p><span class="badge">${item.chancename}</span>￥${chance.money}</p>
						<p>
							<a href="savestatechance.jspx?id=${chance.id}&&state=pading" onclick="return confirm('确定将该机会的设置为跟踪吗？')" style="text-decoration:none;">跟踪</a>
							<a href="saveeditchance.jspx?id=${chance.id}&&state=success" onclick="return confirm('确定将该机会的设置为成功吗？')" style="text-decoration:none;">成功</a>
							<a href="saveeditchance.jspx?id=${chance.id}&&state=lost" onclick="return confirm('确定将该机会的设置为失败吗？')" style="text-decoration:none;">失败</a>
						</p>
					</div>
				</div>
				<div style="box-shadow:0 0 3px #CCCCCC;background-color:#fff;margin-top:-20px;">
					<div style="padding:20px">
						<form action="addevent.jspx" method="post">
							<p><textarea name="des" id="" class="span7"></textarea></p>
							<p class="pull-right"><input type="submit" value="添加事件" class="btn btn-primary"/></p>
							<p><a href="javascript:;" id="showall">显示选项</a></p>
	
								<div id="show-show" style="display:none;">
									<div class="controls">
								 		<label>联系人</label>
	              						<select id="select01" name="contactname" class="span2">
		                  					<c:forEach items="${contactList}" var="ch" >
		                  						<option  value="${ch.contactname}" > ${ch.contactname} </option>
		                  					</c:forEach>
	              						</select>
		              				</div>
									<div class="controls">
								 		<label>事件分类</label>
	              						<select id="select01" name="eventItemname" class="span2">
		                  					<c:forEach items="${eventItemList}" var="ei" >
		                  						<option  value="${ei.itemname}"> ${ei.itemname}</option>
		                  					</c:forEach>
	              						</select><a href="addeventItem.jspx">添加事件分类</a>
		              				</div>
		              			<p>
								<p>谁可以看见这个机会？</p>
								<p><input type="radio" name="see" id="all" checked="checked"/>所有同事</p>
								<p><input type="radio" name="see" id="onlyme" />只有我能看见</p>
								<p>
									<input type="radio" name="see" id="group" />选择一个组...
									<p style="padding-left:20px;display:none" id="group1">

										<select name="" id=""class="span2">
											<option value="">选择一个组</option>
										</select>
									</p>
									<script type="text/javascript">
									var str;
										$(document).ready(function(){
											$("input[type='radio']").click(function(){
											
											var isok=document.getElementById("group").checked;
											var isok1=document.getElementById("all").checked;
											var isok2=document.getElementById("onlyme").checked;
											var isOK=document.getElementById("coleage").checked;
												if(isok){
												str='g';
													$("#group1").attr("style","display:inline;");
												}else{
													$("#group1").attr("style","display:none;");
												}
												if(isOK){
													str="u";
													$("#group2").attr("style","display:inline;");
												}else{
													$("#group2").attr("style","display:none;");
												}
												if(isok1){
													str="A";
												}
												if(isok2){
													str="";
												}
											});
										});
									</script>

								
								<p>
									<input type="radio" name="see" id="coleage" />选择同事...
									<p>
										<p style="padding-left:20px;display:none;"" id="group2">
											<select name="" id=""class="span2">
												<option value="">选择同事</option>
												<c:forEach items="${employeeList}" var="em" >
		                  							<option  value="${em.id}" id="san"> ${em.name} </option>
		                  						</c:forEach>
											</select>
											<a href="javascript:;"><i class="icon-minus"></i></a>
											<a href="javascript:;"><i class="icon-plus"></i></a>
										</p>
					

								<p>邮件通知</p>	
								<p>被勾选的同事将会收到邮件通知。</p>
								<p>
									<input type="checkbox" name="" id="" />所有人
								</p>
								<p>
									<input type="checkbox" name="" id="" />${employee.name}
								</p>
								<hr />

								<p><input type="submit" value="添加事件" class="btn btn-primary" /></p>
								
								<script type="text/javascript">
									$("#showall").click(function(){
										$("#showall").hide();
										$("#show-show").show();
									});
								</script>
							</div>
						</form>
						<c:forEach items="${eventList}" var="ev" >
							<table class="table">
								<tbody>
									<tr>
										<td><img src="image/01.png" alt="" /></td>					
											<td>
												<p><a href="">${contact.contactname}</a> &nbsp&nbsp来自 <a href="eventItem.jspx">${eventItem.itemname}</a> </p>
												<p>${employee.name} 添加 于 ${ev.createtime}</p>
												<p>事件内容:${ev.des}</p>
											</td>									
										<td>
										<p class="pull-right"><a href="eventdiscuss.jspx">评论</a>
										<a href="delEvent.jspx?id=${event.id}" onclick="return confirm('确定将该机会删除吗？')" style="text-decoration:none;">删除</a>
										</p>
										</td>
									</tr>
								</tbody>
							</table>
						</c:forEach>
					</div>
					
				</div>	
			</div>
			<div class="span4">

				<div style="background-color:#fff;border-radius:5px;padding:20px;font-size:18px;box-shadow:4px 5px 5px #252525;">
						<p>背景信息<a href="javascript:;" class="pull-right" id="edit">编辑</a></p>
							<form action="editdes.jspx?id=${chance.id}" method="post" id="beijing" style="display:none;">
								<textarea name="chance.des" id="des" class="span3">${chance.des}</textarea><br />
								<input type="submit" value="保存" class="btn btn-primary" id="btn123"/>&nbsp;&nbsp;<input type="button" value="取消" id="cancle"class="btn" />
							</form>
						<hr />

						<script type="text/javascript">
								
								$("#edit").click(function(){
									$("#edit").hide();
									$("#beijing").show();
								});
								$("#cancle").click(function(){
									$("#edit").show();
									$("#beijing").hide();
								});
						</script>
				</div>
				<div style="margin-top:20px;background-color:#fff;padding:15px;box-shadow:2px 3px 4px #757575">
					<p><strong style="font-size:16px;">相关联系人</strong><span><a href="javascript:;" class="pull-right" id="editordelete">添加/删除</a></span></p>
					<p style="display:none;" id="add-person">
					<input type="text" name="" id="" placeholder="通过搜索添加联系人"/><br />
					<span style="font-size:16px;">已关联的联系人</span>

					</p>
					<table class="table">
						<tbody>
							<tr>
								<td width="10%"><img src="image/head.png" alt="" /></td>
							</tr>
						</tbody>
					</table>
					<script type="text/javascript">
						$("#editordelete").click(function(){
							$("#add-person").toggle();
							//$("#editordelete").text("完成");
							if($("#editordelete").text()=="添加/删除"){
								$("#editordelete").text("完成");
								//$("#add-person").show();
							}else{
								$("#editordelete").text("添加/删除");
								//$("#add-person").hide();
							}
						});
					</script>
				</div>
			</div>
		</div>

    </div>
	
	
	<div class="modal fade" id="myModal">
  <div class="modal-header">
    <a class="close" data-dismiss="modal">×</a>
	
    <h3>添加一个任务</h3>
  </div>
  <div class="modal-body">
    <form action="">

		<input type="text" class="span6"/>
		<label for="">到期时间？
			<select name="" id="">
				<option value="">今天</option>
				<option value="">明天</option>
				<option value="">本周</option>
				<option value="">下周</option>

				<option value="">以后</option>
				<option value="">具体时间</option>
			</select>
		</label>
		<label for="">选择一个分类
			<select name="" id="">
				<option value="">无</option>
				<option value="">添加分类</option>

			</select>
			<a href="">编辑分类</a>
		</label>
	</form>
  </div>
  <div class="modal-footer">
    <a href="#" class="btn btn-primary">添加任务</a>
    <a href="#" class="btn" data-dismiss="modal">取消</a>

  </div>
</div>
</body>
</html>